package com.ss.whisper2.pojo.entity.user;

import org.apache.ibatis.type.Alias;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;
@Alias("User")
public class User implements Serializable {
	@NotEmpty(message = "账号不能为空")
	@Size(min = 2,max = 20,message = "账号长度应在2到20之间")
	private String username;
	@Size(min = 6,max = 20,message = "密码长度应在6到20之间")
	private String password;
	private String nickname;
	private Gender gender;

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public User() {
	}

	public User(String username, String password) {
		this.username = username;
		this.password = password;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public String toString() {
		return "User{" +
				"username='" + username + '\'' +
				", password='" + password + '\'' +
				", nickname='" + nickname + '\'' +
				", gender=" + gender.getValue()+
				'}';
	}
}
